package jane.mvc.actionresults;

import com.google.gson.Gson;

public class JsonResult extends ActionResult implements IActionResult
{
	private Gson gson = null;

	public JsonResult(Object obj)
	{
		this.setContentType("application/json");
		gson = new Gson();
		this.setContent(gson.toJson(obj));
	}

	@Override
	protected void finalize() throws Throwable
	{
		gson = null;
		super.finalize();
	}

	@Override
	public boolean isText()
	{
		return true;
	}

}
